﻿#region Using directives

using System;
using System.Collections.Generic;
using System.Text;

#endregion

namespace Weazel.Badger.Vhdl.Types
{
  public class Conversion
  {
    private TypeId to;
    private TypeId from;
    private ConversionProperties properties;

    #region Properties
    public TypeId To
    {
      get
      {
        return to;
      }

      set
      {
        to = value;
      }
    }

    public TypeId From
    {
      get
      {
        return from;
      }

      set
      {
        from = value;
      }
    }

    public ConversionProperties Properties
    {
      get
      {
        return properties;
      }

      set
      {
        properties = value;
      }
    }
    #endregion

    public Conversion(TypeId from, TypeId to, ConversionProperties properties)
    {
      this.to = to;
      this.from = from;
      this.properties = properties;
    }

    public Conversion(TypeId from, TypeId to)
    {
      this.to = to;
      this.from = from;
      this.properties = ConversionProperties.None;
    }

    public bool HasProperty(ConversionProperties property)
    {
      return (properties & property) == property;
    }
  }
}
